package main

import (
	"github.com/gin-gonic/gin"
	common "project-common"
	"project-user/config"

	//_ "project-user/api" 不要了，换到project-api
	"project-user/router"
)

func main() {
	r := gin.Default()
	////从配置中读取日志配置，初始化日志
	//lc := &logs.LogConfig{
	//	DebugFileName: "E:\\project\\project-management\\service\\logs\\debug\\project-debug.log",
	//	InfoFileName:  "E:\\project\\project-management\\service\\logs\\info\\project-info.log",
	//	WarnFileName:  "E:\\project\\project-management\\service\\logs\\error\\project-error.log",
	//	MaxSize:       500,
	//	MaxAge:        28,
	//	MaxBackups:    3,
	//}
	//err := logs.InitLogger(lc)
	//if err != nil {
	//	log.Fatalln(err)
	//}
	//路由
	router.InitRouter(r)
	// grpc服务注册
	grpc := router.RegisterGrpc()
	//grpc服务注册到etcd
	router.RegisterEtcdServer()
	stop := func() {
		grpc.Stop()
	}
	//common.Run(r, "project-user", ":80")
	common.Run(r, config.C.SC.Name, config.C.SC.Addr, stop)
}
